package com.example.demo.Service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.example.demo.Entity.HistoryVersion;
import com.example.demo.Mapper.HistoryVersionMapper;
import io.swagger.models.auth.In;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class HistoryVersionServiceImp implements HistoryVersionService {
    @Autowired
    HistoryVersionMapper historyVersionMapper;

    @Override
    public void insert(HistoryVersion historyVersion) {
        historyVersionMapper.insert(historyVersion);
    }

    @Override
    public void delete(Integer noteId) {
        QueryWrapper<HistoryVersion> wrapper = new QueryWrapper<HistoryVersion>()
                .eq("note_id", noteId);
        historyVersionMapper.delete(wrapper);
    }

    @Override
    public List<HistoryVersion> select(Integer noteId){
        QueryWrapper<HistoryVersion> wrapper = new QueryWrapper<HistoryVersion>()
                .eq("note_id", noteId);
        historyVersionMapper.selectList(wrapper);
        return null;
    }
}
